﻿using System;
using System.ComponentModel;
using ExFlash.Records;

namespace ExFlash.Tags
{
    [TypeConverter(typeof(AssetDataConverter))]
    public class AssetData : ISwfSerializable
    {
        private readonly int _swfVersion;

        public UInt16 Tag
        {
            get;
            private set;
        }

        public StringRecord Name
        {
            get;
            private set;
        }

        public AssetData(int version)
        {
            _swfVersion = version;
        }

        #region ISwfSerializable Members

        public void SwfDeserialize(BinaryBitReader reader)
        {
            Tag = reader.ReadUInt16();

            Name = new StringRecord(_swfVersion);
            Name.SwfDeserialize(reader);
        }

        public void SwfSerialize(byte[] arr, ref int offset)
        {
            throw new NotImplementedException();
        }

        #endregion
    }

    public class AssetDataConverter : ExpandableObjectConverter
    {

    }
}
